<%@page contentType="text/html; charset=utf-8"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<style>
.page .searchBar label{width:60px;}
</style>
<!-- 此处加action="employeeCtrl.ctrl"是为了条件查询时仍能显示排序图标 -->
<form id="pagerForm" method="post" action="roleList">
	<input type="hidden" name="pageNum" value="${param.pageNum}" />
</form>
<div class="pageHeader">
	<form onsubmit="return navTabSearch(this);" rel="pagerForm"
		method="post" action="roleList">
		<div class="searchBar">
			<input type="hidden" name="numPerPage" value="${numPerPage}" />
			<input type="hidden" name="navTabId" value="${param.navTabId}" />
			<table class="searchContent">
				<tr>
					<td>
						<label>
							角色名称：
						</label>
						<input type="text" class="txtinput" name="roleName" value="${roleName}" />
					</td>
					<td>
						<label>
							状态：
						</label>
						<select class="combox" name="roleStatus">
							<option value='2' ${roleStatus==2?'selected':''}>
								全部
							</option>
							<option value='0' ${roleStatus==0?'selected':''} >
								正常
							</option>
							<option value='1' ${roleStatus==1?'selected':''}>
								冻结
							</option>
						</select>
					</td>
					<td style="">
						<div class="subBar">
							<ul>
								<li>
									<div class="buttonActive">
										<div class="buttonContent">
											<button type="submit">
												检索
											</button>
										</div>
									</div>
								</li>
							</ul>
						</div>
					</td>
				</tr>
			</table>
		</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li>
				<a class="add" style="font-weight: bold;color:#4BBB13;" href="addRole?navTabId=addRole" target="dialog"  maxable="false" 
					width="430" height="250" mask="true"><span>新增角色</span>
				</a>
			</li>
			<li class="line">line</li>
			<li>
				<a class="edit" style="font-weight: bold;color:#6495ED;" href="editRole?roleId={sid_roleId}&navTabId=editRole"
					 target="navTab" rel="editRole"><span>修改角色</span>
				</a>
			</li>
			<li class="line">line</li>
			<li>
				<a class="delete" style="font-weight: bold;color:#C1272A;" href="delRole?roleId={sid_roleId}"
					target="ajaxTodo" title="确定要删除您说选中的角色吗?"><span>删除</span>
				</a>
			</li>
		</ul>
	</div>
	<table class="table" width="100%" layoutH="115">
		<thead>
			<tr>
				<th width="80">
					序号
				</th>
				<th>
					角色ID
				</th>
				<th>
					角色名称
				</th>
				<th>
					状态
				</th>
				<th>
					备注
				</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach var="role" items="${roleList}" varStatus="status">
				<tr target="sid_roleId" rel="${role.id}">
					<td>
						${status.count} 
					</td>
					<td>
						${role.id}
					</td>
					<td>
						${role.roleName}
					</td>
					<td>
						${role.roleDesc }
					</td>
					<td>
						<c:choose>
							<c:when test="${role.status=='0' }">
								<a style="color:#006400; text-decoration: none;">
									有效
								</a>
							</c:when>
							<c:otherwise>
								<a style="color:#f00; text-decoration: none;">
									冻结
								</a>
							</c:otherwise>
						</c:choose>
					</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<!-- pageNum:1是当更改numPerPage时，使pageNum=1重新开始，否则可能无数据 -->
			<select class="combox" name="numPerPage"
				onchange="navTabPageBreak({numPerPage:this.value,pageNum:1})">
				<option value="15" ${numPerPage==15?'selected':''}>
					15
				</option>
				<option value="20" ${numPerPage==20?'selected':''}>
					20
				</option>
				<option value="25" ${numPerPage==25?'selected':''}>
					25
				</option>
				<option value="50" ${numPerPage==50?'selected':''}>
					50
				</option>
				<option value="100" ${numPerPage==100?'selected':''}>
					100
				</option>
			</select>
			<span>条，共${totalCount}条 </span>
		</div>
		<div class="pagination" targetType="navTab" totalCount="${totalCount}" numPerPage="${numPerPage}" pageNumShown="5" currentPage="${pageNum }"></div>
	</div>
</div>
